'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async classify() {
    const { ctx } = this;
    ctx.body = {
      code: 200,
      data: [
        {
          id: 1, name: "分类课程1"
        },
        {
          id: 2, name: "分类课程2"
        },
        {
          id: 3, name: "分类课程3"
        },
        {
          id: 4, name: "分类课程4"
        },
        {
          id: 5, name: "分类课程5"
        },
        {
          id: 6, name: "分类课程6"
        }
      ]
    };
  }


  async AddCourse() {
    const { ctx, ctx: { service, customBody }, app: { mysql } } = this;
    console.log(customBody)
    var {
      courseType, courseName,
      coverImgUrl, teacherName,
      classifyId, chargeType, price
    } = customBody

    ctx.body = customBody

  }
}

module.exports = HomeController;
